using SheLife.Domain.Entities;

namespace SheLife.Application.Interfaces
{
    /// <summary>
    /// 成长目标服务接口
    /// </summary>
    public interface IGrowthGoalService
    {
        /// <summary>
        /// 根据ID获取成长目标
        /// </summary>
        /// <param name="id">成长目标ID</param>
        /// <returns>成长目标实体</returns>
        Task<GrowthGoal?> GetGrowthGoalByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取成长目标列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长目标列表</returns>
        Task<IEnumerable<GrowthGoal>> GetGrowthGoalsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和状态获取成长目标列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="status">状态</param>
        /// <returns>成长目标列表</returns>
        Task<IEnumerable<GrowthGoal>> GetGrowthGoalsByUserIdAndStatusAsync(Guid userId, string status);

        /// <summary>
        /// 根据用户ID和分类获取成长目标列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="category">分类</param>
        /// <returns>成长目标列表</returns>
        Task<IEnumerable<GrowthGoal>> GetGrowthGoalsByUserIdAndCategoryAsync(Guid userId, string category);

        /// <summary>
        /// 创建成长目标
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="targetDate">目标日期</param>
        /// <param name="priority">优先级</param>
        /// <returns>成长目标实体</returns>
        Task<GrowthGoal> CreateGrowthGoalAsync(Guid userId, string title, string description, string category, DateTime? targetDate = null, string priority = "中等");

        /// <summary>
        /// 更新成长目标
        /// </summary>
        /// <param name="id">成长目标ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="targetDate">目标日期</param>
        /// <param name="priority">优先级</param>
        /// <param name="status">状态</param>
        /// <param name="progress">进度</param>
        /// <returns>成长目标实体</returns>
        Task<GrowthGoal?> UpdateGrowthGoalAsync(Guid id, string? title, string? description, string? category, DateTime? targetDate, string? priority, string? status, int? progress);

        /// <summary>
        /// 删除成长目标
        /// </summary>
        /// <param name="id">成长目标ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthGoalAsync(Guid id);

        /// <summary>
        /// 更新成长目标进度
        /// </summary>
        /// <param name="id">成长目标ID</param>
        /// <param name="progress">进度</param>
        /// <returns>成长目标实体</returns>
        Task<GrowthGoal?> UpdateGrowthGoalProgressAsync(Guid id, int progress);
    }

    /// <summary>
    /// 成长目标任务服务接口
    /// </summary>
    public interface IGrowthGoalTaskService
    {
        /// <summary>
        /// 根据ID获取成长目标任务
        /// </summary>
        /// <param name="id">成长目标任务ID</param>
        /// <returns>成长目标任务实体</returns>
        Task<GrowthGoalTask?> GetGrowthGoalTaskByIdAsync(Guid id);

        /// <summary>
        /// 根据目标ID获取成长目标任务列表
        /// </summary>
        /// <param name="goalId">目标ID</param>
        /// <returns>成长目标任务列表</returns>
        Task<IEnumerable<GrowthGoalTask>> GetGrowthGoalTasksByGoalIdAsync(Guid goalId);

        /// <summary>
        /// 根据用户ID获取成长目标任务列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长目标任务列表</returns>
        Task<IEnumerable<GrowthGoalTask>> GetGrowthGoalTasksByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和状态获取成长目标任务列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="status">状态</param>
        /// <returns>成长目标任务列表</returns>
        Task<IEnumerable<GrowthGoalTask>> GetGrowthGoalTasksByUserIdAndStatusAsync(Guid userId, string status);

        /// <summary>
        /// 创建成长目标任务
        /// </summary>
        /// <param name="goalId">目标ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="dueDate">截止日期</param>
        /// <param name="priority">优先级</param>
        /// <returns>成长目标任务实体</returns>
        Task<GrowthGoalTask> CreateGrowthGoalTaskAsync(Guid goalId, string title, string description, DateTime? dueDate = null, string priority = "中等");

        /// <summary>
        /// 更新成长目标任务
        /// </summary>
        /// <param name="id">成长目标任务ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="dueDate">截止日期</param>
        /// <param name="priority">优先级</param>
        /// <param name="status">状态</param>
        /// <returns>成长目标任务实体</returns>
        Task<GrowthGoalTask?> UpdateGrowthGoalTaskAsync(Guid id, string? title, string? description, DateTime? dueDate, string? priority, string? status);

        /// <summary>
        /// 删除成长目标任务
        /// </summary>
        /// <param name="id">成长目标任务ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthGoalTaskAsync(Guid id);

        /// <summary>
        /// 完成成长目标任务
        /// </summary>
        /// <param name="id">成长目标任务ID</param>
        /// <returns>成长目标任务实体</returns>
        Task<GrowthGoalTask?> CompleteGrowthGoalTaskAsync(Guid id);
    }

    /// <summary>
    /// 成长记录服务接口
    /// </summary>
    public interface IGrowthRecordService
    {
        /// <summary>
        /// 根据ID获取成长记录
        /// </summary>
        /// <param name="id">成长记录ID</param>
        /// <returns>成长记录实体</returns>
        Task<GrowthRecord?> GetGrowthRecordByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取成长记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长记录列表</returns>
        Task<IEnumerable<GrowthRecord>> GetGrowthRecordsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和日期范围获取成长记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>成长记录列表</returns>
        Task<IEnumerable<GrowthRecord>> GetGrowthRecordsByUserIdAndDateRangeAsync(Guid userId, DateTime startDate, DateTime endDate);

        /// <summary>
        /// 根据用户ID和分类获取成长记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="category">分类</param>
        /// <returns>成长记录列表</returns>
        Task<IEnumerable<GrowthRecord>> GetGrowthRecordsByUserIdAndCategoryAsync(Guid userId, string category);

        /// <summary>
        /// 创建成长记录
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="title">标题</param>
        /// <param name="content">内容</param>
        /// <param name="category">分类</param>
        /// <param name="mood">心情</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>成长记录实体</returns>
        Task<GrowthRecord> CreateGrowthRecordAsync(Guid userId, string title, string content, string category, string mood, string? imageUrl = null);

        /// <summary>
        /// 更新成长记录
        /// </summary>
        /// <param name="id">成长记录ID</param>
        /// <param name="title">标题</param>
        /// <param name="content">内容</param>
        /// <param name="category">分类</param>
        /// <param name="mood">心情</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>成长记录实体</returns>
        Task<GrowthRecord?> UpdateGrowthRecordAsync(Guid id, string? title, string? content, string? category, string? mood, string? imageUrl = null);

        /// <summary>
        /// 删除成长记录
        /// </summary>
        /// <param name="id">成长记录ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthRecordAsync(Guid id);
    }

    /// <summary>
    /// 成长里程碑服务接口
    /// </summary>
    public interface IGrowthMilestoneService
    {
        /// <summary>
        /// 根据ID获取成长里程碑
        /// </summary>
        /// <param name="id">成长里程碑ID</param>
        /// <returns>成长里程碑实体</returns>
        Task<GrowthMilestone?> GetGrowthMilestoneByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取成长里程碑列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长里程碑列表</returns>
        Task<IEnumerable<GrowthMilestone>> GetGrowthMilestonesByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和分类获取成长里程碑列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="category">分类</param>
        /// <returns>成长里程碑列表</returns>
        Task<IEnumerable<GrowthMilestone>> GetGrowthMilestonesByUserIdAndCategoryAsync(Guid userId, string category);

        /// <summary>
        /// 创建成长里程碑
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="achievedDate">达成日期</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>成长里程碑实体</returns>
        Task<GrowthMilestone> CreateGrowthMilestoneAsync(Guid userId, string title, string description, string category, DateTime achievedDate, string? imageUrl = null);

        /// <summary>
        /// 更新成长里程碑
        /// </summary>
        /// <param name="id">成长里程碑ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="achievedDate">达成日期</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>成长里程碑实体</returns>
        Task<GrowthMilestone?> UpdateGrowthMilestoneAsync(Guid id, string? title, string? description, string? category, DateTime? achievedDate, string? imageUrl = null);

        /// <summary>
        /// 删除成长里程碑
        /// </summary>
        /// <param name="id">成长里程碑ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthMilestoneAsync(Guid id);
    }

    /// <summary>
    /// 成长计划服务接口
    /// </summary>
    public interface IGrowthPlanService
    {
        /// <summary>
        /// 根据ID获取成长计划
        /// </summary>
        /// <param name="id">成长计划ID</param>
        /// <returns>成长计划实体</returns>
        Task<GrowthPlan?> GetGrowthPlanByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取成长计划列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长计划列表</returns>
        Task<IEnumerable<GrowthPlan>> GetGrowthPlansByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和状态获取成长计划列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="status">状态</param>
        /// <returns>成长计划列表</returns>
        Task<IEnumerable<GrowthPlan>> GetGrowthPlansByUserIdAndStatusAsync(Guid userId, string status);

        /// <summary>
        /// 根据用户ID和分类获取成长计划列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="category">分类</param>
        /// <returns>成长计划列表</returns>
        Task<IEnumerable<GrowthPlan>> GetGrowthPlansByUserIdAndCategoryAsync(Guid userId, string category);

        /// <summary>
        /// 创建成长计划
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>成长计划实体</returns>
        Task<GrowthPlan> CreateGrowthPlanAsync(Guid userId, string title, string description, string category, DateTime startDate, DateTime endDate);

        /// <summary>
        /// 更新成长计划
        /// </summary>
        /// <param name="id">成长计划ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <param name="status">状态</param>
        /// <param name="progress">进度</param>
        /// <returns>成长计划实体</returns>
        Task<GrowthPlan?> UpdateGrowthPlanAsync(Guid id, string? title, string? description, string? category, DateTime? startDate, DateTime? endDate, string? status, int? progress);

        /// <summary>
        /// 删除成长计划
        /// </summary>
        /// <param name="id">成长计划ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthPlanAsync(Guid id);

        /// <summary>
        /// 更新成长计划进度
        /// </summary>
        /// <param name="id">成长计划ID</param>
        /// <param name="progress">进度</param>
        /// <returns>成长计划实体</returns>
        Task<GrowthPlan?> UpdateGrowthPlanProgressAsync(Guid id, int progress);
    }

    /// <summary>
    /// 成长计划步骤服务接口
    /// </summary>
    public interface IGrowthPlanStepService
    {
        /// <summary>
        /// 根据ID获取成长计划步骤
        /// </summary>
        /// <param name="id">成长计划步骤ID</param>
        /// <returns>成长计划步骤实体</returns>
        Task<GrowthPlanStep?> GetGrowthPlanStepByIdAsync(Guid id);

        /// <summary>
        /// 根据计划ID获取成长计划步骤列表
        /// </summary>
        /// <param name="planId">计划ID</param>
        /// <returns>成长计划步骤列表</returns>
        Task<IEnumerable<GrowthPlanStep>> GetGrowthPlanStepsByPlanIdAsync(Guid planId);

        /// <summary>
        /// 根据用户ID获取成长计划步骤列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长计划步骤列表</returns>
        Task<IEnumerable<GrowthPlanStep>> GetGrowthPlanStepsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和状态获取成长计划步骤列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="status">状态</param>
        /// <returns>成长计划步骤列表</returns>
        Task<IEnumerable<GrowthPlanStep>> GetGrowthPlanStepsByUserIdAndStatusAsync(Guid userId, string status);

        /// <summary>
        /// 创建成长计划步骤
        /// </summary>
        /// <param name="planId">计划ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="order">顺序</param>
        /// <param name="dueDate">截止日期</param>
        /// <returns>成长计划步骤实体</returns>
        Task<GrowthPlanStep> CreateGrowthPlanStepAsync(Guid planId, string title, string description, int order, DateTime? dueDate = null);

        /// <summary>
        /// 更新成长计划步骤
        /// </summary>
        /// <param name="id">成长计划步骤ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="order">顺序</param>
        /// <param name="dueDate">截止日期</param>
        /// <param name="status">状态</param>
        /// <returns>成长计划步骤实体</returns>
        Task<GrowthPlanStep?> UpdateGrowthPlanStepAsync(Guid id, string? title, string? description, int? order, DateTime? dueDate, string? status);

        /// <summary>
        /// 删除成长计划步骤
        /// </summary>
        /// <param name="id">成长计划步骤ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthPlanStepAsync(Guid id);

        /// <summary>
        /// 完成成长计划步骤
        /// </summary>
        /// <param name="id">成长计划步骤ID</param>
        /// <returns>成长计划步骤实体</returns>
        Task<GrowthPlanStep?> CompleteGrowthPlanStepAsync(Guid id);
    }

    /// <summary>
    /// 成长习惯服务接口
    /// </summary>
    public interface IGrowthHabitService
    {
        /// <summary>
        /// 根据ID获取成长习惯
        /// </summary>
        /// <param name="id">成长习惯ID</param>
        /// <returns>成长习惯实体</returns>
        Task<GrowthHabit?> GetGrowthHabitByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取成长习惯列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长习惯列表</returns>
        Task<IEnumerable<GrowthHabit>> GetGrowthHabitsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和分类获取成长习惯列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="category">分类</param>
        /// <returns>成长习惯列表</returns>
        Task<IEnumerable<GrowthHabit>> GetGrowthHabitsByUserIdAndCategoryAsync(Guid userId, string category);

        /// <summary>
        /// 创建成长习惯
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="frequency">频率</param>
        /// <param name="targetValue">目标值</param>
        /// <returns>成长习惯实体</returns>
        Task<GrowthHabit> CreateGrowthHabitAsync(Guid userId, string title, string description, string category, string frequency, int targetValue);

        /// <summary>
        /// 更新成长习惯
        /// </summary>
        /// <param name="id">成长习惯ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="frequency">频率</param>
        /// <param name="targetValue">目标值</param>
        /// <param name="isActive">是否激活</param>
        /// <returns>成长习惯实体</returns>
        Task<GrowthHabit?> UpdateGrowthHabitAsync(Guid id, string? title, string? description, string? category, string? frequency, int? targetValue, bool? isActive);

        /// <summary>
        /// 删除成长习惯
        /// </summary>
        /// <param name="id">成长习惯ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthHabitAsync(Guid id);
    }

    /// <summary>
    /// 成长习惯记录服务接口
    /// </summary>
    public interface IGrowthHabitRecordService
    {
        /// <summary>
        /// 根据ID获取成长习惯记录
        /// </summary>
        /// <param name="id">成长习惯记录ID</param>
        /// <returns>成长习惯记录实体</returns>
        Task<GrowthHabitRecord?> GetGrowthHabitRecordByIdAsync(Guid id);

        /// <summary>
        /// 根据习惯ID获取成长习惯记录列表
        /// </summary>
        /// <param name="habitId">习惯ID</param>
        /// <returns>成长习惯记录列表</returns>
        Task<IEnumerable<GrowthHabitRecord>> GetGrowthHabitRecordsByHabitIdAsync(Guid habitId);

        /// <summary>
        /// 根据用户ID获取成长习惯记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长习惯记录列表</returns>
        Task<IEnumerable<GrowthHabitRecord>> GetGrowthHabitRecordsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和日期范围获取成长习惯记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>成长习惯记录列表</returns>
        Task<IEnumerable<GrowthHabitRecord>> GetGrowthHabitRecordsByUserIdAndDateRangeAsync(Guid userId, DateTime startDate, DateTime endDate);

        /// <summary>
        /// 创建成长习惯记录
        /// </summary>
        /// <param name="habitId">习惯ID</param>
        /// <param name="date">日期</param>
        /// <param name="value">值</param>
        /// <param name="notes">备注</param>
        /// <returns>成长习惯记录实体</returns>
        Task<GrowthHabitRecord> CreateGrowthHabitRecordAsync(Guid habitId, DateTime date, int value, string? notes = null);

        /// <summary>
        /// 更新成长习惯记录
        /// </summary>
        /// <param name="id">成长习惯记录ID</param>
        /// <param name="value">值</param>
        /// <param name="notes">备注</param>
        /// <returns>成长习惯记录实体</returns>
        Task<GrowthHabitRecord?> UpdateGrowthHabitRecordAsync(Guid id, int? value, string? notes);

        /// <summary>
        /// 删除成长习惯记录
        /// </summary>
        /// <param name="id">成长习惯记录ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthHabitRecordAsync(Guid id);

        /// <summary>
        /// 获取习惯统计数据
        /// </summary>
        /// <param name="habitId">习惯ID</param>
        /// <param name="days">统计天数</param>
        /// <returns>统计数据字典</returns>
        Task<Dictionary<string, object>> GetHabitStatisticsAsync(Guid habitId, int days = 30);
    }

    /// <summary>
    /// 成长习惯模板服务接口
    /// </summary>
    public interface IGrowthHabitTemplateService
    {
        /// <summary>
        /// 根据ID获取成长习惯模板
        /// </summary>
        /// <param name="id">成长习惯模板ID</param>
        /// <returns>成长习惯模板实体</returns>
        Task<GrowthHabitTemplate?> GetGrowthHabitTemplateByIdAsync(Guid id);

        /// <summary>
        /// 获取所有成长习惯模板
        /// </summary>
        /// <returns>成长习惯模板列表</returns>
        Task<IEnumerable<GrowthHabitTemplate>> GetAllGrowthHabitTemplatesAsync();

        /// <summary>
        /// 根据分类获取成长习惯模板列表
        /// </summary>
        /// <param name="category">分类</param>
        /// <returns>成长习惯模板列表</returns>
        Task<IEnumerable<GrowthHabitTemplate>> GetGrowthHabitTemplatesByCategoryAsync(string category);

        /// <summary>
        /// 搜索成长习惯模板
        /// </summary>
        /// <param name="keyword">关键词</param>
        /// <returns>成长习惯模板列表</returns>
        Task<IEnumerable<GrowthHabitTemplate>> SearchGrowthHabitTemplatesAsync(string keyword);

        /// <summary>
        /// 创建成长习惯模板
        /// </summary>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="frequency">频率</param>
        /// <param name="targetValue">目标值</param>
        /// <returns>成长习惯模板实体</returns>
        Task<GrowthHabitTemplate> CreateGrowthHabitTemplateAsync(string title, string description, string category, string frequency, int targetValue);

        /// <summary>
        /// 更新成长习惯模板
        /// </summary>
        /// <param name="id">成长习惯模板ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="frequency">频率</param>
        /// <param name="targetValue">目标值</param>
        /// <returns>成长习惯模板实体</returns>
        Task<GrowthHabitTemplate?> UpdateGrowthHabitTemplateAsync(Guid id, string? title, string? description, string? category, string? frequency, int? targetValue);

        /// <summary>
        /// 删除成长习惯模板
        /// </summary>
        /// <param name="id">成长习惯模板ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthHabitTemplateAsync(Guid id);
    }

    /// <summary>
    /// 用户成长习惯模板服务接口
    /// </summary>
    public interface IUserGrowthHabitTemplateService
    {
        /// <summary>
        /// 根据ID获取用户成长习惯模板
        /// </summary>
        /// <param name="id">用户成长习惯模板ID</param>
        /// <returns>用户成长习惯模板实体</returns>
        Task<UserGrowthHabitTemplate?> GetUserGrowthHabitTemplateByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取用户成长习惯模板列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>用户成长习惯模板列表</returns>
        Task<IEnumerable<UserGrowthHabitTemplate>> GetUserGrowthHabitTemplatesByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和模板ID获取用户成长习惯模板列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="templateId">模板ID</param>
        /// <returns>用户成长习惯模板列表</returns>
        Task<IEnumerable<UserGrowthHabitTemplate>> GetUserGrowthHabitTemplatesByUserIdAndTemplateIdAsync(Guid userId, Guid templateId);

        /// <summary>
        /// 创建用户成长习惯模板
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="templateId">模板ID</param>
        /// <param name="notes">备注</param>
        /// <returns>用户成长习惯模板实体</returns>
        Task<UserGrowthHabitTemplate> CreateUserGrowthHabitTemplateAsync(Guid userId, Guid templateId, string? notes = null);

        /// <summary>
        /// 更新用户成长习惯模板
        /// </summary>
        /// <param name="id">用户成长习惯模板ID</param>
        /// <param name="notes">备注</param>
        /// <returns>用户成长习惯模板实体</returns>
        Task<UserGrowthHabitTemplate?> UpdateUserGrowthHabitTemplateAsync(Guid id, string? notes);

        /// <summary>
        /// 删除用户成长习惯模板
        /// </summary>
        /// <param name="id">用户成长习惯模板ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteUserGrowthHabitTemplateAsync(Guid id);
    }

    /// <summary>
    /// 成长伙伴服务接口
    /// </summary>
    public interface IGrowthPartnerService
    {
        /// <summary>
        /// 根据ID获取成长伙伴
        /// </summary>
        /// <param name="id">成长伙伴ID</param>
        /// <returns>成长伙伴实体</returns>
        Task<GrowthPartner?> GetGrowthPartnerByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取成长伙伴列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长伙伴列表</returns>
        Task<IEnumerable<GrowthPartner>> GetGrowthPartnersByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和状态获取成长伙伴列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="status">状态</param>
        /// <returns>成长伙伴列表</returns>
        Task<IEnumerable<GrowthPartner>> GetGrowthPartnersByUserIdAndStatusAsync(Guid userId, string status);

        /// <summary>
        /// 创建成长伙伴
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="partnerUserId">伙伴用户ID</param>
        /// <param name="notes">备注</param>
        /// <returns>成长伙伴实体</returns>
        Task<GrowthPartner> CreateGrowthPartnerAsync(Guid userId, Guid partnerUserId, string? notes = null);

        /// <summary>
        /// 更新成长伙伴
        /// </summary>
        /// <param name="id">成长伙伴ID</param>
        /// <param name="notes">备注</param>
        /// <param name="status">状态</param>
        /// <returns>成长伙伴实体</returns>
        Task<GrowthPartner?> UpdateGrowthPartnerAsync(Guid id, string? notes, string? status);

        /// <summary>
        /// 删除成长伙伴
        /// </summary>
        /// <param name="id">成长伙伴ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthPartnerAsync(Guid id);

        /// <summary>
        /// 接受成长伙伴邀请
        /// </summary>
        /// <param name="id">成长伙伴ID</param>
        /// <returns>成长伙伴实体</returns>
        Task<GrowthPartner?> AcceptGrowthPartnerAsync(Guid id);

        /// <summary>
        /// 拒绝成长伙伴邀请
        /// </summary>
        /// <param name="id">成长伙伴ID</param>
        /// <returns>成长伙伴实体</returns>
        Task<GrowthPartner?> RejectGrowthPartnerAsync(Guid id);
    }

    /// <summary>
    /// 成长伙伴互动服务接口
    /// </summary>
    public interface IGrowthPartnerInteractionService
    {
        /// <summary>
        /// 根据ID获取成长伙伴互动
        /// </summary>
        /// <param name="id">成长伙伴互动ID</param>
        /// <returns>成长伙伴互动实体</returns>
        Task<GrowthPartnerInteraction?> GetGrowthPartnerInteractionByIdAsync(Guid id);

        /// <summary>
        /// 根据伙伴ID获取成长伙伴互动列表
        /// </summary>
        /// <param name="partnerId">伙伴ID</param>
        /// <returns>成长伙伴互动列表</returns>
        Task<IEnumerable<GrowthPartnerInteraction>> GetGrowthPartnerInteractionsByPartnerIdAsync(Guid partnerId);

        /// <summary>
        /// 根据用户ID获取成长伙伴互动列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长伙伴互动列表</returns>
        Task<IEnumerable<GrowthPartnerInteraction>> GetGrowthPartnerInteractionsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和日期范围获取成长伙伴互动列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>成长伙伴互动列表</returns>
        Task<IEnumerable<GrowthPartnerInteraction>> GetGrowthPartnerInteractionsByUserIdAndDateRangeAsync(Guid userId, DateTime startDate, DateTime endDate);

        /// <summary>
        /// 创建成长伙伴互动
        /// </summary>
        /// <param name="partnerId">伙伴ID</param>
        /// <param name="userId">用户ID</param>
        /// <param name="type">类型</param>
        /// <param name="content">内容</param>
        /// <returns>成长伙伴互动实体</returns>
        Task<GrowthPartnerInteraction> CreateGrowthPartnerInteractionAsync(Guid partnerId, Guid userId, string type, string content);

        /// <summary>
        /// 更新成长伙伴互动
        /// </summary>
        /// <param name="id">成长伙伴互动ID</param>
        /// <param name="content">内容</param>
        /// <returns>成长伙伴互动实体</returns>
        Task<GrowthPartnerInteraction?> UpdateGrowthPartnerInteractionAsync(Guid id, string? content);

        /// <summary>
        /// 删除成长伙伴互动
        /// </summary>
        /// <param name="id">成长伙伴互动ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthPartnerInteractionAsync(Guid id);
    }

    /// <summary>
    /// 成长激励服务接口
    /// </summary>
    public interface IGrowthIncentiveService
    {
        /// <summary>
        /// 根据ID获取成长激励
        /// </summary>
        /// <param name="id">成长激励ID</param>
        /// <returns>成长激励实体</returns>
        Task<GrowthIncentive?> GetGrowthIncentiveByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取成长激励列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长激励列表</returns>
        Task<IEnumerable<GrowthIncentive>> GetGrowthIncentivesByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和类型获取成长激励列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="type">类型</param>
        /// <returns>成长激励列表</returns>
        Task<IEnumerable<GrowthIncentive>> GetGrowthIncentivesByUserIdAndTypeAsync(Guid userId, string type);

        /// <summary>
        /// 根据用户ID和状态获取成长激励列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="status">状态</param>
        /// <returns>成长激励列表</returns>
        Task<IEnumerable<GrowthIncentive>> GetGrowthIncentivesByUserIdAndStatusAsync(Guid userId, string status);

        /// <summary>
        /// 创建成长激励
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="type">类型</param>
        /// <param name="condition">条件</param>
        /// <param name="reward">奖励</param>
        /// <returns>成长激励实体</returns>
        Task<GrowthIncentive> CreateGrowthIncentiveAsync(Guid userId, string title, string description, string type, string condition, string reward);

        /// <summary>
        /// 更新成长激励
        /// </summary>
        /// <param name="id">成长激励ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="type">类型</param>
        /// <param name="condition">条件</param>
        /// <param name="reward">奖励</param>
        /// <param name="status">状态</param>
        /// <returns>成长激励实体</returns>
        Task<GrowthIncentive?> UpdateGrowthIncentiveAsync(Guid id, string? title, string? description, string? type, string? condition, string? reward, string? status);

        /// <summary>
        /// 删除成长激励
        /// </summary>
        /// <param name="id">成长激励ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthIncentiveAsync(Guid id);

        /// <summary>
        /// 领取成长激励
        /// </summary>
        /// <param name="id">成长激励ID</param>
        /// <returns>成长激励实体</returns>
        Task<GrowthIncentive?> ClaimGrowthIncentiveAsync(Guid id);
    }

    /// <summary>
    /// 成长激励记录服务接口
    /// </summary>
    public interface IGrowthIncentiveRecordService
    {
        /// <summary>
        /// 根据ID获取成长激励记录
        /// </summary>
        /// <param name="id">成长激励记录ID</param>
        /// <returns>成长激励记录实体</returns>
        Task<GrowthIncentiveRecord?> GetGrowthIncentiveRecordByIdAsync(Guid id);

        /// <summary>
        /// 根据激励ID获取成长激励记录列表
        /// </summary>
        /// <param name="incentiveId">激励ID</param>
        /// <returns>成长激励记录列表</returns>
        Task<IEnumerable<GrowthIncentiveRecord>> GetGrowthIncentiveRecordsByIncentiveIdAsync(Guid incentiveId);

        /// <summary>
        /// 根据用户ID获取成长激励记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>成长激励记录列表</returns>
        Task<IEnumerable<GrowthIncentiveRecord>> GetGrowthIncentiveRecordsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和日期范围获取成长激励记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>成长激励记录列表</returns>
        Task<IEnumerable<GrowthIncentiveRecord>> GetGrowthIncentiveRecordsByUserIdAndDateRangeAsync(Guid userId, DateTime startDate, DateTime endDate);

        /// <summary>
        /// 创建成长激励记录
        /// </summary>
        /// <param name="incentiveId">激励ID</param>
        /// <param name="userId">用户ID</param>
        /// <param name="type">类型</param>
        /// <param name="description">描述</param>
        /// <returns>成长激励记录实体</returns>
        Task<GrowthIncentiveRecord> CreateGrowthIncentiveRecordAsync(Guid incentiveId, Guid userId, string type, string description);

        /// <summary>
        /// 更新成长激励记录
        /// </summary>
        /// <param name="id">成长激励记录ID</param>
        /// <param name="description">描述</param>
        /// <returns>成长激励记录实体</returns>
        Task<GrowthIncentiveRecord?> UpdateGrowthIncentiveRecordAsync(Guid id, string? description);

        /// <summary>
        /// 删除成长激励记录
        /// </summary>
        /// <param name="id">成长激励记录ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteGrowthIncentiveRecordAsync(Guid id);
    }

    /// <summary>
    /// 成长统计服务接口
    /// </summary>
    public interface IGrowthStatisticsService
    {
        /// <summary>
        /// 获取成长统计数据
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="days">统计天数</param>
        /// <returns>统计数据字典</returns>
        Task<Dictionary<string, object>> GetGrowthStatisticsAsync(Guid userId, int days = 30);

        /// <summary>
        /// 获取目标完成统计
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="days">统计天数</param>
        /// <returns>统计数据字典</returns>
        Task<Dictionary<string, object>> GetGoalCompletionStatisticsAsync(Guid userId, int days = 30);

        /// <summary>
        /// 获取习惯坚持统计
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="days">统计天数</param>
        /// <returns>统计数据字典</returns>
        Task<Dictionary<string, object>> GetHabitPersistenceStatisticsAsync(Guid userId, int days = 30);

        /// <summary>
        /// 获取成长趋势统计
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="days">统计天数</param>
        /// <returns>统计数据字典</returns>
        Task<Dictionary<string, object>> GetGrowthTrendStatisticsAsync(Guid userId, int days = 30);
    }
}